package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.Visit;
import com.zzyl.vo.VisitVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface VisitMapper {

    int update(Visit visit);

    int deleteById(Long id);

    Visit findById(Long id);

    List<Visit> findAll(@Param("mobile") String mobile, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
    @Insert("insert into visit (name, mobile, time, visitor, type, status, create_time, update_time, create_by, update_by, remark) " +
            "values(#{name},#{mobile},#{time},#{visitor},#{type},#{status},#{createTime},#{updateTime},#{createBy},#{updateBy},#{remark})")
    void add(Visit visit);


    Page<Visit> getBypage(int pageNum, int pageSize, String name, String phone, Integer status, Integer type, Long userId, LocalDateTime startTime, LocalDateTime endTime);
}
